<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  

  
  <title>015.PHP中的文件处理与代码复用 | 似南-全栈开发路上的探索者、追梦人</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  
  
  
  <meta name="keywords" content="似南,FaithSinan" />
  
  <meta name="description" content="PHP文件系统之读取文件内容PHP具有丰富的文件操作函数，最简单的读取文件的函数为file_get_contents，可以将整个文件全部读取到一个字符串中,也可以通过参数控制读取内容的开始点以及长度。 1$content &#x3D; file_get_contents(&#39;.&#x2F;test.txt&#39;, null, null, 100, 500);">
<meta property="og:type" content="article">
<meta property="og:title" content="015.PHP中的文件处理与代码复用">
<meta property="og:url" content="http://yoursite.com/2019/08/17/015.PHP%E4%B8%AD%E7%9A%84%E6%96%87%E4%BB%B6%E5%A4%84%E7%90%86%E4%B8%8E%E4%BB%A3%E7%A0%81%E5%A4%8D%E7%94%A8/index.html">
<meta property="og:site_name" content="似南-全栈开发路上的探索者、追梦人">
<meta property="og:description" content="PHP文件系统之读取文件内容PHP具有丰富的文件操作函数，最简单的读取文件的函数为file_get_contents，可以将整个文件全部读取到一个字符串中,也可以通过参数控制读取内容的开始点以及长度。 1$content &#x3D; file_get_contents(&#39;.&#x2F;test.txt&#39;, null, null, 100, 500);">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2019-08-17T14:19:00.000Z">
<meta property="article:modified_time" content="2020-10-30T07:33:23.870Z">
<meta property="article:author" content="FaithSinan">
<meta property="article:tag" content="学习指南">
<meta name="twitter:card" content="summary">
  
    <link rel="alternate" href="/atom.xml" title="似南-全栈开发路上的探索者、追梦人" type="application/atom+xml">
  
  
    <link rel="icon" href="/images/avatar.png">
  
  
    <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
  
  
<link rel="stylesheet" href="/css/style.css">

  
<link rel="stylesheet" href="/css/highlight.css">

<meta name="generator" content="Hexo 4.2.1"></head>

<body>
  <div id="fullpage" class="mobile-nav-right">
    
      <div id="wrapper" title="图片来自网络">
    
    
      <header id="header">
  <div id="nav-toggle" class="nav-toggle"></div>
  <div class="head-box global-width">
    <nav class="nav-box nav-left">
      
        <a class="nav-item" href="/" title
        
        >首页</a>
      
        <a class="nav-item" href="/archives" title
        
        >归档</a>
      
    </nav>
  </div>
</header>
      <div id="middlecontent" title class="global-width sidebar-left">
        <section id="main"><article id="post-015.PHP中的文件处理与代码复用" class="article global-container article-type-post" itemscope itemprop="blogPost">
  
    <header class="article-header">
      
  
    <h1 class="article-title" itemprop="name">
      015.PHP中的文件处理与代码复用
    </h1>
  

    </header>
  
  <div class="article-meta">
    <a href="/2019/08/17/015.PHP%E4%B8%AD%E7%9A%84%E6%96%87%E4%BB%B6%E5%A4%84%E7%90%86%E4%B8%8E%E4%BB%A3%E7%A0%81%E5%A4%8D%E7%94%A8/" class="article-date">
  <time datetime="2019-08-17T14:19:00.000Z" itemprop="datePublished">2019-08-17</time>
</a>
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/Web%E5%85%A8%E6%A0%88%E6%9E%B6%E6%9E%84/">Web全栈架构</a>►<a class="article-category-link" href="/categories/Web%E5%85%A8%E6%A0%88%E6%9E%B6%E6%9E%84/PHP/">PHP</a>
  </div>

    
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E5%AD%A6%E4%B9%A0%E6%8C%87%E5%8D%97/" rel="tag">学习指南</a></li></ul>

  </div>
  
    <span id="busuanzi_container_page_pv">
      本文总阅读量<span id="busuanzi_value_page_pv"></span>次
    </span>
  

  <div class="article-inner">
    
    <div class="article-content article-content-cloud" itemprop="articleBody">
      
        <h4 id="PHP文件系统之读取文件内容"><a href="#PHP文件系统之读取文件内容" class="headerlink" title="PHP文件系统之读取文件内容"></a><strong>PHP文件系统之读取文件内容</strong></h4><p>PHP具有丰富的文件操作函数，最简单的读取文件的函数为file_get_contents，可以将整个文件全部读取到一个字符串中,也可以通过参数控制读取内容的开始点以及长度。</p>
<div class="highlight-box"autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="true"data-rel="PHP"><figure class="iseeu highlight /php"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$content = file_get_contents(<span class="string">'./test.txt'</span>, <span class="keyword">null</span>, <span class="keyword">null</span>, <span class="number">100</span>, <span class="number">500</span>);</span><br></pre></td></tr></table></figure></div>

<a id="more"></a>

<p>PHP也提供类似于C语言操作文件的方法，使用fopen，fgets，fread等方法，fgets可以从文件指针中读取一行，freads可以读取指定长度的字符串。使用fopen打开的文件，最好使用fclose关闭文件指针，以避免文件句柄被占用。</p>
<div class="highlight-box"autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="true"data-rel="PHP"><figure class="iseeu highlight /php"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">$fp = fopen(<span class="string">'./text.txt'</span>, <span class="string">'rb'</span>);</span><br><span class="line">$contents = <span class="string">''</span>;</span><br><span class="line"><span class="keyword">while</span>(!feof($fp)) &#123;</span><br><span class="line">    $content01 .= fgets($fp);  <span class="comment">//读取一行</span></span><br><span class="line">    $content02 .= fread($fp, <span class="number">4096</span>);  <span class="comment">//一次读取4096个字符</span></span><br><span class="line">&#125;</span><br><span class="line">fclose($fp);</span><br></pre></td></tr></table></figure></div>



<h4 id="PHP文件系统之判断文件是否存在"><a href="#PHP文件系统之判断文件是否存在" class="headerlink" title="PHP文件系统之判断文件是否存在"></a><strong>PHP文件系统之判断文件是否存在</strong></h4><p>一般情况下在对文件进行操作的时候需要先判断文件是否存在，PHP中常用来判断文件存在的函数有两个is_file与file_exists。<br>file_exists不仅可以判断文件是否存在，同时也可以判断目录是否存在，从函数名可以看出，is_file是确切的判断给定的路径是否是一个文件。<br>更加精确的可以使用is_readable与is_writeable在文件是否存在的基础上，判断文件是否可读与可写。</p>
<p>示例：</p>
<div class="highlight-box"autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="true"data-rel="PHP"><figure class="iseeu highlight /php"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">$filename = <span class="string">'/date/test.txt'</span>;</span><br><span class="line"><span class="comment">//判断如果$filename文件存在的话 就输出文件内容</span></span><br><span class="line"><span class="keyword">if</span> (file_exists($filename)) &#123;</span><br><span class="line">    <span class="keyword">echo</span> <span class="string">'文件存在'</span>;</span><br><span class="line">&#125;<span class="keyword">else</span>&#123;</span><br><span class="line">   <span class="keyword">echo</span> <span class="string">'文件不存在'</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></div>


<h4 id="PHP文件系统之取得文件的修改时间"><a href="#PHP文件系统之取得文件的修改时间" class="headerlink" title="PHP文件系统之取得文件的修改时间"></a><strong>PHP文件系统之取得文件的修改时间</strong></h4><p>文件有很多元属性，包括：文件的所有者、创建时间、修改时间、最后的访问时间等。</p>
<ul>
<li>fileowner：获得文件的所有者</li>
<li>filectime：获取文件的创建时间</li>
<li>filemtime：获取文件的修改时间</li>
<li>fileatime：获取文件的访问时间</li>
</ul>
<p>示例：</p>
<div class="highlight-box"autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="true"data-rel="PHP"><figure class="iseeu highlight /php"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">$mtime = filemtime($filename);</span><br><span class="line"><span class="keyword">echo</span> <span class="string">'修改时间：'</span>.date(<span class="string">'Y-m-d H:i:s'</span>, filemtime($filename));</span><br></pre></td></tr></table></figure></div>


<h4 id="PHP文件系统之取得文件的大小"><a href="#PHP文件系统之取得文件的大小" class="headerlink" title="PHP文件系统之取得文件的大小"></a><strong>PHP文件系统之取得文件的大小</strong></h4><p>通过filesize函数可以取得文件的大小，文件大小是以字节数表示的。</p>
<p>示例：</p>
<div class="highlight-box"autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="true"data-rel="PHP"><figure class="iseeu highlight /php"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">$filename = <span class="string">'/date/test.txt'</span>;</span><br><span class="line"></span><br><span class="line">$size = filesize($filename);</span><br></pre></td></tr></table></figure></div>


<h4 id="PHP文件系统之写入内容到文件"><a href="#PHP文件系统之写入内容到文件" class="headerlink" title="PHP文件系统之写入内容到文件"></a><strong>PHP文件系统之写入内容到文件</strong></h4><p>与读取文件对应，PHP写文件也具有两种方式，最简单的方式是采用file_put_contents。</p>
<p>示例：</p>
<div class="highlight-box"autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="true"data-rel="PHP"><figure class="iseeu highlight /php"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">$filename = <span class="string">'./test.txt'</span>;</span><br><span class="line">$data = <span class="string">'test'</span>;</span><br><span class="line">file_put_contents($filename, $data);</span><br></pre></td></tr></table></figure></div>

<p>同样的，PHP也支持类似C语言风格的操作方式，采用fwrite进行文件写入。</p>
<p>示例：</p>
<div class="highlight-box"autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="true"data-rel="PHP"><figure class="iseeu highlight /php"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">$fp = fopen(<span class="string">'./test.txt'</span>, <span class="string">'w'</span>);</span><br><span class="line">fwrite($fp, <span class="string">'hello'</span>);</span><br><span class="line">fwrite($fp, <span class="string">'world'</span>);</span><br><span class="line">fclose($fp);</span><br></pre></td></tr></table></figure></div>


<h4 id="PHP文件系统之删除文件"><a href="#PHP文件系统之删除文件" class="headerlink" title="PHP文件系统之删除文件"></a><strong>PHP文件系统之删除文件</strong></h4><p>跟Unix系统命令类似，PHP使用unlink函数进行文件删除。</p>
<div class="highlight-box"autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="true"data-rel="PHP"><figure class="iseeu highlight /php"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">$filename = <span class="string">'./test.txt'</span>;</span><br><span class="line"></span><br><span class="line">unlink($filename);</span><br></pre></td></tr></table></figure></div>

<p>删除文件夹使用rmdir函数，文件夹必须为空，如果不为空或者没有权限则会提示失败。</p>
<div class="highlight-box"autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="true"data-rel="PHP"><figure class="iseeu highlight /php"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">$filename = <span class="string">'./test.txt'</span>;</span><br><span class="line"></span><br><span class="line">rmdir($dir);</span><br></pre></td></tr></table></figure></div>

<p>如果文件夹中存在文件，可以先循环删除目录中的所有文件，然后再删除该目录，循环删除可以使用glob函数遍历所有文件。</p>
<div class="highlight-box"autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="true"data-rel="PHP"><figure class="iseeu highlight /php"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">$filename = <span class="string">'./test.txt'</span>;</span><br><span class="line"></span><br><span class="line"><span class="keyword">foreach</span> (glob(<span class="string">"*"</span>) <span class="keyword">as</span> $filename) &#123;</span><br><span class="line">   unlink($filename);</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></div>


<h4 id="PHP异常处理之抛出一个异常"><a href="#PHP异常处理之抛出一个异常" class="headerlink" title="PHP异常处理之抛出一个异常"></a><strong>PHP异常处理之抛出一个异常</strong></h4><p>从PHP5开始，PHP支持异常处理，异常处理是面向对象一个重要特性，PHP代码中的异常通过throw抛出，异常抛出之后，后面的代码将不会再被执行。</p>
<p>既然抛出异常会中断程序执行，那么为什么还需要使用异常处理？</p>
<p>异常抛出被用于在遇到未知错误，或者不符合预先设定的条件时，通知客户程序，以便进行其他相关处理，不至于使程序直接报错中断。</p>
<p>当代码中使用了try catch的时候，抛出的异常会在catch中捕获，否则会直接中断。</p>
<p>1、基本语法<br>        try{<br>            //可能出现错误或异常的代码<br>            //catch表示捕获，Exception是php已定义好的异常类<br>        } catch(Exception $e){<br>            //对异常处理，方法：<br>                //1、自己处理<br>                //2、不处理，将其再次抛出<br>        }</p>
<p>2、处理处理程序应当包括：<br>Try - 使用异常的函数应该位于 “try”  代码块内。如果没有触发异常，则代码将照常继续执行。但是如果异常被触发，会抛出一个异常。<br>Throw - 这里规定如何触发异常。注意：每一个 “throw” 必须对应至少一个 “catch”，当然可以对应多个”catch”<br>Catch - “catch” 代码块会捕获异常，并创建一个包含异常信息的对象。</p>
<p>示例：</p>
<div class="highlight-box"autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="true"data-rel="PHP"><figure class="iseeu highlight /php"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//创建可抛出一个异常的函数</span></span><br><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">checkNum</span><span class="params">($number)</span></span>&#123;</span><br><span class="line">     <span class="keyword">if</span>($number&gt;<span class="number">1</span>)&#123;</span><br><span class="line">         <span class="keyword">throw</span> <span class="keyword">new</span> <span class="keyword">Exception</span>(<span class="string">"异常提示-数字必须小于等于1"</span>);</span><br><span class="line">     &#125;</span><br><span class="line">     <span class="keyword">return</span> <span class="keyword">true</span>;</span><br><span class="line"> &#125;</span><br><span class="line"> </span><br><span class="line"><span class="comment">//在 "try" 代码块中触发异常</span></span><br><span class="line"> <span class="keyword">try</span>&#123;</span><br><span class="line">     checkNum(<span class="number">2</span>);</span><br><span class="line">     <span class="comment">//如果异常被抛出，那么下面一行代码将不会被输出</span></span><br><span class="line">     <span class="keyword">echo</span> <span class="string">'如果能看到这个提示，说明你的数字小于等于1'</span>;</span><br><span class="line"> &#125;<span class="keyword">catch</span>(<span class="keyword">Exception</span> $e)&#123;</span><br><span class="line">     <span class="comment">//捕获异常</span></span><br><span class="line">     <span class="keyword">echo</span> <span class="string">'捕获异常: '</span> .$e-&gt;getMessage();</span><br><span class="line"> &#125;</span><br></pre></td></tr></table></figure></div>


<h4 id="包含自定义函数文件"><a href="#包含自定义函数文件" class="headerlink" title="包含自定义函数文件"></a><strong>包含自定义函数文件</strong></h4><p>对于想在多处使用已封装好的自定义函数库，可以使用包含函数文件的方式，可以避免多处重写相同函数，支持.php、.html等多种web文档格式。</p>
<p>两种包含方式：<br><strong>require/require_once</strong></p>
<div class="highlight-box"autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="true"data-rel="PHP"><figure class="iseeu highlight /php"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">require</span> <span class="string">'xxxx.php'</span>;  <span class="comment">//同文件多次包含，多次生效</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">require_once</span> <span class="string">'xxxx.php'</span>;  <span class="comment">//同文件多次包含，只生效一次</span></span><br></pre></td></tr></table></figure></div>
<p>通过require/require_once包含的文件不存在时，会产生一个致命错误和一个警告，程序终止执行。</p>
<p><strong>include/include_once</strong></p>
<div class="highlight-box"autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" contenteditable="true"data-rel="PHP"><figure class="iseeu highlight /php"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">include</span> <span class="string">'xxxx.php'</span>;</span><br><span class="line"></span><br><span class="line"><span class="keyword">include_once</span> <span class="string">'xxxx.php'</span>;</span><br></pre></td></tr></table></figure></div>
<p>通过include/include_once包含的文件不存在时，会产生两个警告，程序继续执行。</p>
<p>require是一个预置行为，无条件的包含。这个函式通常放在PHP程式的最前面，PHP程式在执行前，就会先包含require所指定文件，即使可能不执行。</p>
<p>include是一个过程行为，有条件的包含。这个函式通常放在流程控制的处理区段中，PHP程式网页在读到include的档案时，才将它读进来，引入是有条件的，发生在程序执行时，只有条件成立时才导入，可简化编译生成的代码。</p>
<hr>
<p>源自：本篇文章为慕课网PHP入门教程的知识总结<br>声明：以上内容如有不足之处，欢迎联系指正，转载请注明出处！</p>

      
    </div>
    
      <footer class="article-footer">
        完
      </footer>
    
  </div>
  
    
<nav id="article-nav">
  <div class="article-nav-block">
    
      <a href="/2019/08/17/016.PHP%E4%B8%AD%E7%9A%84%E5%BC%82%E5%B8%B8%E5%A4%84%E7%90%86%E6%9C%BA%E5%88%B6/" id="article-nav-newer" class="article-nav-link-wrap">
        <strong class="article-nav-caption"></strong>
        <div class="article-nav-title">
          
            016.PHP中的异常处理机制
          
        </div>
      </a>
    
  </div>
  <div class="article-nav-block">
    
      <a href="/2019/08/17/014.PHP%E4%B9%8B%E6%AD%A3%E5%88%99%E8%A1%A8%E8%BE%BE%E5%BC%8F%E7%AE%80%E4%BB%8B%E4%B8%8E%E4%BC%9A%E8%AF%9D%E6%8E%A7%E5%88%B6/" id="article-nav-older" class="article-nav-link-wrap">
        <div class="article-nav-title">014.PHP之正则表达式简介与会话控制</div>
        <strong class="article-nav-caption"></strong>
      </a>
    
  </div>
</nav>

    <link rel="stylesheet" href="/css/gitment.css"> 
<script src="/js/gitment.js"></script>

<div id="gitmentContainer"></div>

<script>
var gitment = new Gitment({
  owner: '',
  repo: '',
  oauth: {
    client_id: '',
    client_secret: '',
  },
})
gitment.render('gitmentContainer')
</script>

  
  
</article>
</section>
        <aside id="sidebar">
  
    <div class="widget-box">
  <div class="avatar-box">
    <img class="avatar" src="/images/avatar.png" title="图片来自网络"></img>
    <h3 class="avatar-name">
      
        似南
      
    </h3>
    <p class="avatar-slogan">
      天空透露着微光，照亮虚无迷惘。
    </p>
  </div>
</div>


  
    
  <div class="widget-box">
    <h3 class="widget-title">分类</h3>
    <div class="widget">
      <ul class="category-list"><li class="category-list-item"><a class="category-list-link" href="/categories/Web%E5%85%A8%E6%A0%88%E6%9E%B6%E6%9E%84/">Web全栈架构</a><ul class="category-list-child"><li class="category-list-item"><a class="category-list-link" href="/categories/Web%E5%85%A8%E6%A0%88%E6%9E%B6%E6%9E%84/Java/">Java</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/Web%E5%85%A8%E6%A0%88%E6%9E%B6%E6%9E%84/JavaScript/">JavaScript</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/Web%E5%85%A8%E6%A0%88%E6%9E%B6%E6%9E%84/PHP/">PHP</a></li></ul></li><li class="category-list-item"><a class="category-list-link" href="/categories/%E6%95%B0%E6%8D%AE%E5%BA%93/">数据库</a><ul class="category-list-child"><li class="category-list-item"><a class="category-list-link" href="/categories/%E6%95%B0%E6%8D%AE%E5%BA%93/MySQL/">MySQL</a></li></ul></li><li class="category-list-item"><a class="category-list-link" href="/categories/%E7%BB%BC%E5%90%88%E6%8A%80%E6%9C%AF%E6%A0%88/">综合技术栈</a><ul class="category-list-child"><li class="category-list-item"><a class="category-list-link" href="/categories/%E7%BB%BC%E5%90%88%E6%8A%80%E6%9C%AF%E6%A0%88/Git/">Git</a></li></ul></li><li class="category-list-item"><a class="category-list-link" href="/categories/%E8%BF%90%E7%BB%B4%E6%8A%80%E6%9C%AF/">运维技术</a><ul class="category-list-child"><li class="category-list-item"><a class="category-list-link" href="/categories/%E8%BF%90%E7%BB%B4%E6%8A%80%E6%9C%AF/Linux%E7%B3%BB%E7%BB%9F%E8%BF%90%E7%BB%B4/">Linux系统运维</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/%E8%BF%90%E7%BB%B4%E6%8A%80%E6%9C%AF/Web%E5%AE%89%E5%85%A8/">Web安全</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/%E8%BF%90%E7%BB%B4%E6%8A%80%E6%9C%AF/%E6%95%B0%E9%80%9A/">数通</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/%E8%BF%90%E7%BB%B4%E6%8A%80%E6%9C%AF/%E8%99%9A%E6%8B%9F%E5%8C%96/">虚拟化</a></li></ul></li></ul>
    </div>
  </div>


  
    
  <div class="widget-box">
    <h3 class="widget-title">标签云</h3>
    <div class="widget tagcloud">
      <a href="/tags/Docker/" style="font-size: 10px;">Docker</a> <a href="/tags/Hexo/" style="font-size: 10px;">Hexo</a> <a href="/tags/JDBC/" style="font-size: 15px;">JDBC</a> <a href="/tags/JavaGUI/" style="font-size: 10px;">JavaGUI</a> <a href="/tags/MyBatis/" style="font-size: 10px;">MyBatis</a> <a href="/tags/SSH/" style="font-size: 10px;">SSH</a> <a href="/tags/Servlet/" style="font-size: 10px;">Servlet</a> <a href="/tags/Socket/" style="font-size: 10px;">Socket</a> <a href="/tags/Spring/" style="font-size: 10px;">Spring</a> <a href="/tags/SpringBoot/" style="font-size: 15px;">SpringBoot</a> <a href="/tags/SpringCloud/" style="font-size: 10px;">SpringCloud</a> <a href="/tags/Telnet/" style="font-size: 10px;">Telnet</a> <a href="/tags/VLAN/" style="font-size: 15px;">VLAN</a> <a href="/tags/%E4%BC%98%E5%8C%96/" style="font-size: 10px;">优化</a> <a href="/tags/%E4%BD%BF%E7%94%A8%E6%8C%87%E5%8D%97/" style="font-size: 10px;">使用指南</a> <a href="/tags/%E5%8D%8F%E8%AE%AE%E5%88%86%E6%9E%90/" style="font-size: 10px;">协议分析</a> <a href="/tags/%E5%A2%9E%E5%88%A0%E6%94%B9%E6%9F%A5/" style="font-size: 10px;">增删改查</a> <a href="/tags/%E5%A4%87%E4%BB%BD/" style="font-size: 10px;">备份</a> <a href="/tags/%E5%A4%9A%E7%BA%BF%E7%A8%8B/" style="font-size: 10px;">多线程</a> <a href="/tags/%E5%A4%9A%E8%A1%A8%E6%9F%A5%E8%AF%A2/" style="font-size: 10px;">多表查询</a> <a href="/tags/%E5%AD%A6%E4%B9%A0%E6%8C%87%E5%8D%97/" style="font-size: 20px;">学习指南</a> <a href="/tags/%E6%80%9D%E7%A7%91%E6%95%B0%E9%80%9A/" style="font-size: 15px;">思科数通</a> <a href="/tags/%E6%8E%A5%E5%8F%A3%E8%AF%B7%E6%B1%82/" style="font-size: 10px;">接口请求</a> <a href="/tags/%E6%95%85%E9%9A%9C%E6%8E%92%E9%99%A4/" style="font-size: 10px;">故障排除</a> <a href="/tags/%E6%97%A0%E7%BA%BFWiFi/" style="font-size: 10px;">无线WiFi</a> <a href="/tags/%E6%9D%83%E9%99%90%E6%8E%A7%E5%88%B6/" style="font-size: 10px;">权限控制</a> <a href="/tags/%E7%9B%91%E6%8E%A7/" style="font-size: 10px;">监控</a> <a href="/tags/%E7%AB%AF%E5%8F%A3%E9%85%8D%E7%BD%AE/" style="font-size: 10px;">端口配置</a> <a href="/tags/%E7%B4%A2%E5%BC%95/" style="font-size: 15px;">索引</a> <a href="/tags/%E8%99%9A%E6%8B%9F%E6%9C%BA/" style="font-size: 10px;">虚拟机</a> <a href="/tags/%E8%AF%BB%E4%B9%A6%E7%AC%94%E8%AE%B0/" style="font-size: 10px;">读书笔记</a> <a href="/tags/%E8%B7%AF%E7%94%B1%E9%85%8D%E7%BD%AE/" style="font-size: 10px;">路由配置</a> <a href="/tags/%E9%9B%86%E7%BE%A4/" style="font-size: 10px;">集群</a>
    </div>
  </div>

  
    
  <div class="widget-box">
    <h3 class="widget-title">归档</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2021/11/">十一月 2021</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2021/07/">七月 2021</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/12/">十二月 2020</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/11/">十一月 2020</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/10/">十月 2020</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/08/">八月 2020</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/06/">六月 2020</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/05/">五月 2020</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/04/">四月 2020</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/03/">三月 2020</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/01/">一月 2020</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/12/">十二月 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/11/">十一月 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/10/">十月 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/08/">八月 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/07/">七月 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/06/">六月 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/05/">五月 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/04/">四月 2019</a></li></ul>
    </div>
  </div>

  
    
  <div class="widget-box">
    <h3 class="widget-title">最新文章</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/2021/11/16/046%E3%80%81%E6%95%B0%E6%8D%AE%E5%BA%93%E4%BA%8B%E5%8A%A1%E7%9B%B8%E5%85%B3%E7%9F%A5%E8%AF%86%E6%A2%B3%E7%90%86/">046、数据库事务相关知识梳理</a>
          </li>
        
          <li>
            <a href="/2021/11/15/045.%E6%95%B0%E6%8D%AE%E5%BA%93%E7%B4%A2%E5%BC%95%E7%9F%A5%E8%AF%86%E6%A2%B3%E7%90%86/">045.数据库索引知识梳理</a>
          </li>
        
          <li>
            <a href="/2021/11/12/044.%E6%95%B0%E6%8D%AE%E5%BA%93%E5%A4%9A%E8%A1%A8%E6%9F%A5%E8%AF%A2%E6%96%B9%E5%BC%8F/">044.数据库多表查询方式</a>
          </li>
        
          <li>
            <a href="/2021/11/03/043.Java%20%E5%A4%9A%E7%BA%BF%E7%A8%8B%E6%A6%82%E8%A6%81/">043.Java 多线程概要</a>
          </li>
        
          <li>
            <a href="/2021/07/31/042.SpringCloud%E5%BE%AE%E6%9C%8D%E5%8A%A1%E5%AE%9E%E7%8E%B0/">042.SpringCloud 微服务实现</a>
          </li>
        
      </ul>
    </div>
  </div>

  
      <div class="widget-box">
    <h3 class="widget-title">友链</h3>
    <div class="widget">
      
        <a style="display: block;" href="https://yiluyanxia.github.io/" title target='_blank'
        >一路眼瞎</a>
      
    </div>
  </div>

  
</aside>
      </div>
      <footer id="footer">
  <div class="foot-box global-width">
    &copy; 2022 FaithSinan &nbsp;&nbsp;
    驱动于 <a href="http://hexo.io/" target="_blank">Hexo</a>
    &nbsp;|&nbsp;基于 <a href="https://github.com/yiluyanxia/hexo-theme-antiquity" target="_blank" rel="noopener">antiquity</a>
    <br>
    <script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    <span id="busuanzi_container_site_pv">不蒜子告之   阁下是第<span id="busuanzi_value_site_pv"></span>个访客</span>
  </div>
</footer>
      <script src="https://code.jquery.com/jquery-2.0.3.min.js"></script>
<script>
if (!window.jQuery) {
var script = document.createElement('script');
script.src = "/js/jquery-2.0.3.min.js";
document.body.write(script);
}
</script>

  
<link rel="stylesheet" href="/fancybox/jquery.fancybox.css">

  
<script src="/fancybox/jquery.fancybox.pack.js"></script>




<script src="/js/script.js"></script>




    </div>
    <nav id="mobile-nav" class="mobile-nav-box">
  <div class="mobile-nav-img mobile-nav-top"></div>
  
    <a href="/" class="mobile-nav-link">首页</a>
  
    <a href="/archives" class="mobile-nav-link">归档</a>
  
  <div class="mobile-nav-img  mobile-nav-bottom"></div>
</nav>    
  </div>
</body>
</html>